package com.treasure.service.constant;


public class Constants {

    /**
     * 异常信息统一头信息<br>
     * 非常遗憾的通知您,程序发生了异常
     */
    public static final String Exception_Head = "OH,MY GOD! SOME ERRORS OCCURED! AS FOLLOWS :";

	public static final String YES = "Y";
	public static final String NO = "N";

	public static final String SUCCESS = "success";
	public static final String ERROR = "error";

	/**
	 * 消息类型
	 * */
	public static class MessageType{
		public static String COMMON = "1";//普通消息
		public static String ACTIVITY = "2";//活动消息
	}

	/**
	 * 支付方式
	 * */
	public static class PayType{
		public static int SHORTCUT = 1;//快捷支付
		public static int INTERNETBANK = 2;//网银支付
	}

	/**
	 * 支付状态
	 * */
	public static class PayStatus{
		public static int ING = 0;//支付中
		public static int BE_SUCCESS = 1;//预支付成功
		public static int BE_FAIL = 2;//预支付失败
		public static int SUCCESS = 3;//确认支付成功
		public static int FAIL = 4;//确认支付失败
		public static String W_SUCCESS ="SUCCESS";
		public static String W_FAIL ="FAIL";
	}

	/**
	 * 业务类型：31自己办卡返佣 32邀请他人办卡返佣 33下级邀请办卡返佣 34邀请会员返佣
	 */
	public static class InviteType{

		public static Integer CTRANSACTION__CARD_ONESELF = 31;//自己办理信用卡返佣
		public static Integer CHILD_CTRANSACTION_CARD =32;//邀请他人办卡返佣
		public static Integer GRANDSON_CTRANSACTION_CARD =33;//下级邀请办卡返佣
		public static Integer CHILD_CTRANSACTION_MEMBER =34;//邀请会员返佣

	}

	/**
	 * 获取财富值类型
	 */
	public static class TreasurePrice{

		public static Integer EARN_EARNINGS=41;//赚取收益
		public static Integer CHILD_CTRANSACTION_CARD =42;//邀请他人办卡
		public static Integer INVITE_MEMBERS=43;//邀请会员

	}

	/**
	 * 会员的等级
	 */
	public static enum  Grade{

		GENERAL_MEMBER(0,"业务员"),
		PAY_MEMBER(1,"创业者"),
		SYB_ELEMENTARY(2,"创业家"),
		SYB_MIDDLE(3,"合伙人");

		private Integer code;
		private String msgpresentation;

		private Grade(int code, String msgpresentation) {
			this.code=code;
			this.msgpresentation=msgpresentation;

		}

		public Integer getCode() {
			return code;
		}

		public void setCode(Integer code) {
			this.code = code;
		}

		public String getMsgpresentation() {
			return msgpresentation;
		}

		public void setMsgpresentation(String msgpresentation) {
			this.msgpresentation = msgpresentation;
		}

		public static String getValue(int code) {
			for (Grade grade : values()) {
				if (grade.getCode() == code) {
					return grade.getMsgpresentation();
				}
			}
			return null;
		}

	}


}
